package com.tuanzi.loan.web.bean.system.log;

import javax.annotation.PostConstruct;
import javax.faces.bean.ViewScoped;

import org.springframework.stereotype.Component;

import com.tuanzi.loan.log.vo.request.LoginLogSearchRequest;
import com.tuanzi.loan.log.vo.response.LoginLogSearchResponse;
import com.tuanzi.loan.web.configuration.JSFListingBean;
import com.tuanzi.loan.web.lazy.system.LoginLogLazyDataModel;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author Ray 2017/09/21
 */
@Data
@Component
@ViewScoped
@EqualsAndHashCode(callSuper = true)
public class LoginLogBean extends JSFListingBean<LoginLogSearchRequest, LoginLogSearchResponse> {

    private static final long serialVersionUID = -2152778554108785342L;

    @PostConstruct
    private void init() {
        initLazyDataModel();
    }

    public void onReset() {
        initLazyDataModel();
    }

    private void initLazyDataModel() {
        $ = new LoginLogSearchRequest();
        lazyDataModel = new LoginLogLazyDataModel($);
    }
}
